// common.h -- Defines typedefs and some global functions.
//             From JamesM's kernel development tutorials.

#ifndef COMMON_H
#define COMMON_H

// Some nice typedefs, to standardise sizes across platforms.
// These typedefs are written for 32-bit X86.
typedef unsigned int   u32int;
typedef          int   s32int;
typedef unsigned short u16int;
typedef          short s16int;
typedef unsigned char  u8int;
typedef          char  s8int;



u8int* memcpy(u8int* dest,const u8int* src,int count);
u8int* memset(u8int* dest,u8int val, int count);
u16int *memsetw(u16int* dest,u16int val,int count);
u16int* memcpyw(u16int* dest, u16int* src, int count);
u32int strlen(u8int* str);
u8int inportb(u16int _port);
void outportb(u16int _port,u8int _data);



#define PANIC(msg) panic(msg, __FILE__, __LINE__);
#define ASSERT(b) ((b) ? (void)0 : panic_assert(__FILE__, __LINE__, #b))

void panic(const char *message, const char *file, u32int line);
void panic_assert(const char *file, u32int line, const char *desc);


#endif // COMMON_H
